<?php defined('IN_ADMIN') or exit('Access Denied!'); ?>

<form action="/admin/dish/save/<?=intval($shop_id);?>" method="post" id="myform">
  <input type="hidden" name="method" value="<?=$method;?>" />
  <input type="hidden" name="dish_id" value="<?=i($data['dish_id']);?>" />
  <input type="hidden" name="ordnum" value="<?=i($data['ordnum']);?>" />
  <div class="pad-10">
    <div class="col-tab">
      <ul class="tabBut cu-li" id="tab_setting">
        <li id="tab_setting_1" class="on">基本信息</li>
      </ul>
      <div class="content pad-10">
        <table width="100%" class="table_form">
          <tbody>
            <tr>
              <td width="100">选择分类：</td>
              <td class="y-bg"><select name="dish_cat" id="dish_cat">
                  <option>选择分类</option>
                  <?=View::options($cats, $data['dish_cat']);?>
                </select></td>
            </tr>
            <tr>
              <td width="100">菜品名称：</td>
              <td class="y-bg"><input type="text" class="input-text" name="name" id="name" size="50" value="<?=h($data['name']);?>" /></td>
            </tr>
            <tr>
              <td width="100">封面图像：</td>
              <td class="y-bg"><div class="create-picture">
                <img id="picshow-0" src="<?=empty($data['picture']) ? STATIC_URL.'img/common/upload.gif' : UPLOAD_URL.$data['picture'] ;?>" height="110"> </div>
                <input type="hidden" id="picture-0" name="picture" value="<?=h($data['picture']);?>" />
                <a href="#" id="upfile-0">[上传照片]</a><span id="pictip-0"></span></td>
            </tr>
            <tr>
              <td width="100">价格：</td>
              <td class="y-bg"><input type="text" class="input-text" name="price" id="price" size="50" value="<?=h($data['price']);?>" /></td>
            </tr>
            <tr>
              <td width="100">描述：</td>
              <td class="y-bg"><textarea name="description" id="description" cols="40" rows="3"><?=h($data['description']);?></textarea></td>
            </tr>
          </tbody>
        </table>
      </div>
      <div class="bk15"></div>
      <div class="btn">
        <input name="dosubmit" id="dosubmit" type="submit" value="提交" class="button">
      </div>
    </div>
  </div>
</form>
<script type="text/javascript" language="javascript" src="<?=STATIC_URL;?>js/ajaxupload.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    //剪裁图片
    var img_w = 200;
    var img_h = 200;
    $("#pictip-0").text("（尺寸为" +img_w+ "x" +img_h+ "）");
    $("#upfile-0").click(function(){
        window.top.art.dialog(
            {id:"tailor", iframe:"/admin/attach/tailor?width=" +img_w+ "&height=" +img_h+ "", title:"图片剪裁", width:750, height:530, lock:true}
        );
    });
});
</script>
